LSP/Textmate: Implement multiview support for generic/textmate based syntax support#8080
Merged
matthiasblaesing merged 2 commits intoapache:masterfrom Apr 6, 2025
Merged
Conversation
Contributor
Author
|
@lahodaj would you mind having a look at this? I think multi-view is benefical for the generic lsp integration as that for example allows sane usage of git integration. |
…syntax support Closes: apache#5204
b3a786d to
beea5ce
Compare
…t be parsed After beea5ce (LSP/Textmate: Implement multiview support for generic/textmate based syntax support) it was observed, that occasionally an IllegalArgumentException was raised from the MimeResolverImpl (see full stacktrace below). The error message indicates that the description file is not valid anymore. This matches the renewal of the registration at startup. Log this on info level, so that is not raised to users attention, as for the LSP case, the updated file is available milliseconds later and should regenerate the resolvers in the next iteration. java.lang.IllegalArgumentException: MultiFileObject@d1d4bdb[Services/MIMEResolver/c.xml] parent: MultiFileObject@27ddc920[Services/MIMEResolver] validFlag: false validRoot: MultiFileObject@49354fe[root of SystemFileSystem[org.netbeans.core.startup.layers.SystemFileSystem@20cea7a4]] isValidRoot: true at org.netbeans.modules.openide.filesystems.declmime.MIMEResolverImpl.create(MIMEResolverImpl.java:344) at org.netbeans.modules.openide.filesystems.declmime.MIMEResolverImpl.forDescriptor(MIMEResolverImpl.java:67) at org.openide.filesystems.MIMESupport$CachedFileObject.declarativeResolvers(MIMESupport.java:256) at org.openide.filesystems.MIMESupport$CachedFileObject.getResolvers(MIMESupport.java:197) at org.openide.filesystems.MIMESupport$CachedFileObject.resolveMIME(MIMESupport.java:340) at org.openide.filesystems.MIMESupport$CachedFileObject.getMIMEType(MIMESupport.java:287) at org.openide.filesystems.MIMESupport.findMIMEType(MIMESupport.java:111) at org.openide.filesystems.FileUtil.getMIMEType(FileUtil.java:1388) at org.openide.filesystems.FileObject.getMIMEType(FileObject.java:642) at org.openide.filesystems.AbstractFileObject.getMIMEType(AbstractFileObject.java:169) at org.openide.filesystems.MultiFileObject.getMIMEType(MultiFileObject.java:623) at org.openide.filesystems.MultiFileObject.getMIMEType(MultiFileObject.java:623) at org.openide.loaders.DataLoaderPool.allLoaders(DataLoaderPool.java:307) at org.openide.loaders.DataLoaderPool.findDataObject(DataLoaderPool.java:505) [catch] at org.openide.loaders.FolderList.createBoth(FolderList.java:743) at org.openide.loaders.FolderList.getObjects(FolderList.java:539) at org.openide.loaders.FolderList.access$600(FolderList.java:52) at org.openide.loaders.FolderList$ListTask.computeResult(FolderList.java:938) at org.openide.loaders.FolderList$ListTask.run(FolderList.java:914) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1403) at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:45) at org.openide.util.lookup.Lookups.executeWith(Lookups.java:287) at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2018)
Contributor
Author
|
I intent to merge this by of this week. If anyone wants to object, please do so now. |
Contributor
Author
|
Hearing no objections, lets get this in. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Multiview support for example is utilized by per-file history:
In the screenshot a C# file is opened with the CSharp grammar loaded and the history of the file can be also added.
Closes: #5204